<script type="text/javascript">
  window.onload = function(){
     ConvertRowsToLinks("data_table1");
 	 ConvertRowsToLinks("data_table2");
	 ConvertRowsToLinks("data_table3");
	 ConvertRowsToLinks("data_table4");
	 ConvertRowsToLinks("data_table5");
  }
  
  function ConvertRowsToLinks(xTableId){

	if(document.getElementById(xTableId) != null)
	{

    	var rows = document.getElementById(xTableId).getElementsByTagName("tr");

	    for(i=0;i<rows.length;i++){
	      var link = rows[i].getElementsByTagName("a")
	      if(link.length == 1){
	        rows[i].onclick = new Function("document.location.href='" + link[0].href + "'");
	      }
	    }
	
	}

  }

</script>

<div id="view_black">
  <div id="dashboard">
	  
	  <% if flash[:notice] %><h2 style="text-align:center"><%= flash[:notice] %></h2><% end %>
	
	  <div id="dashboard_border">
  		<div id="dashboard_bar">
  		  <h1>All Users</h1>
  		  <div id="clear"></div>
  		</div>  		
	
  		<table id="data_table1" class="dashboard_table">
  			<tr><td id="indicator"></td><td>Name</td><td>Login</td><td>Email</td><td>Roles</td></tr>

  			<% @users.each do |user|%>
  				<tr id="data" class="<%= cycle('odd', 'even') %>">
  					<td id="indicator"> </td>
  					<td><%= link_to user.full_name, edit_user_path(user) %></td>
  					<td><%= user.login %></td>
  					<td><%= user.email %></td>
  					<td><%= user.roles_as_csv %></td>
  				</tr>
  			<% end %>

  		</table>

  	</div>	
	</div>
</div>